#include <stdio.h>
#define __USE_GNU
#include <dlfcn.h>
#include <stdint.h>

static void* (*___real_malloc)(size_t)=NULL;

extern void *malloc(size_t size) {
	void *p = NULL;
    if(___real_malloc == NULL) ___real_malloc = dlsym(RTLD_NEXT, "malloc");
    p = ___real_malloc(size);
    fprintf(stderr, "malloc(%u)\t= %p\n", (unsigned)size, p);
    return p;
}
